package com.warmup.model;
import java.util.Objects;

public class Student1 {
    private final String studentId;
    private String name;
    private int age;

    public Student1(String studentId, String name, int age) {
        this.studentId = studentId;
        this.name = name;
        this.age = age;
    }

    public String getStudentId() {
        return studentId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "学号: " + studentId + ", 姓名: " + name + ", 年龄: " + age;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student1 student1 = (Student1) o;
        return Objects.equals(studentId, student1.studentId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(studentId);
    }

}
